package com.example.devicemanage.dao;


import com.example.devicemanage.entity.Repair;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface RepairMapper {

    @Insert("INSERT INTO repair (eid,rcosts,rmanu,rdate,master) VALUES (#{0},#{1},#{2},#{3},#{4})")
    int insertRepair(String eid, int rcosts, String rmanu, String rdate, String master);

    @Select("SELECT * FROM repair")
    List<Repair> showAllRepair();

    @Delete("DELETE FROM repair WHERE repairid=#{repairid}")
    int deleteById(int repairid);
    @Insert("INSERT INTO repair (repairid,eid,rcosts,rmanu,rdate,master) VALUES (#{repairid},#{eid},#{rcosts},#{rmanu},#{rdate},#{master})")
    int updateRepair(Repair repair);
}
